<?
include('../json/header_table.php');
?> $("#flex1").flexigrid({
url: 'ref_jadwal_mapel_json.php',
dataType: 'json',
colModel : [
{display: ' Kd Ref Jadwal Mapel', name : 'kd_ref_jadwal_mapel', width : 100, sortable : true, align: 'center'},
{display: ' Kd Mapel', name : 'kd_mapel', width : 100, sortable : true, align: 'center'},
{display: ' Kd Jadwal', name : 'kd_jadwal', width : 100, sortable : true, align: 'center'},
{display: ' Waktu', name : 'waktu', width : 100, sortable : true, align: 'center'},
],
buttons : [
{name: 'Add', bclass: 'add', onpress : Add},
{separator: true}
],
searchitems : [
{display: 'ISO', name : 'iso'},
{display: 'Name', name : 'name', isdefault: true}
],
sortname: "kd_siswa",
sortorder: "asc",
usepager: true,
title: 'Kelas',
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 890,
onSubmit: addFormData,
height: 200
}); //This function adds paramaters to the post of flexigrid. You can add a verification as well by return to false if you don't want flexigrid to submit
function addFormData(){
//passing a form object to serializeArray will get the valid data from all the objects, but, if the you pass a non-form object, you have to specify the input elements that the data will come from
var dt = $('#sform').serializeArray();
$("#flex1").flexOptions({params: dt});
return true;
}
$('#sform').submit(function (){
$('#flex1').flexOptions({newp: 1}).flexReload();
return false;
});
function Add()
{
alert('Add');
}
function Delete()
{
alert('Delete');
}
<? //============================= Button ============================
include('../json/footer_table.php');
?> 